<div class="calendar_header">
<div class="arrow">
    {if $prev_month_end}
    <a href="{$prev_month_end|date_format:$url_format}" class="arrow">&larr;</a>
    {else}
    &nbsp;
    {/if}
</div>
<div class="month">{$month_name}&nbsp;{$year}</div>
<div class="arrow">
    {if $next_month_begin}
    <a href="{$next_month_begin|date_format:$url_format}" class="arrow">&rarr;</a>
    {else}
    &nbsp;
    {/if}
</div>
<div class="break"></div>
</div>
<table class="calendar" border="0" cellpadding="0" cellspacing="1">
	<tr>
	{section name="day_of_week" loop=$day_of_week_abbrevs}
		<th class="day-of-week">{$day_of_week_abbrevs[day_of_week]}</th>
	{/section}
	</tr>
    <tr>
        <th class="day-of-week_border" colspan="7"></th>
    </tr>
	{section name="row" loop=$calendar}
		<tr>
			{section name="col" loop=$calendar[row]}
				{assign var="date" value=$calendar[row][col]}
				{assign var="month_day" value=$date|date_format:"%e"}
				{if $date == $selected_date}
					<td class="selected-day">{$month_day}</td>
				{elseif $date|date_format:"%m" == $month}
					<td class="{if in_array($month_day, $enabled)}appointment{else}day{/if}">
						{if in_array($month_day, $enabled)}
						<a href="{$date|date_format:$url_format}">{$month_day}</a>
						{else}
						{$month_day}
						{/if}
					</td>
				{else}
					<td class="day outside">{$month_day}</td>
				{/if}
			{/section}
		</tr>
	{/section}
</table>
